<?php $this->load->view('header'); ?>

<!--MAIN-->
<div id="search-project">
    <?php echo $this->load->view('sideBlocks/searchBlock') ?>
</div>
<!-- Page Content -->
<div class="wrap-content wrap-project">
<div class="container">
<div class="buyer-profile">

<div class="row">
    <div class="border-green2 border col-md-1 col-xs-1 "></div>
    <div class="container">
        <div class="row title-project">
            <h2 class="quote-55"><?php echo $this->lang->line("Profile") ?></h2>
        </div>
    </div>
</div>
<div class="row">
<div
    class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding profile-user">
<div class="col-lg-3 col-md-3 col-sm-3 no-padding avatar-user">
    <div class="col-lg-12 col-md-12 col-sm-12 image-avatar-user">
        <a href="#">
        	<img class="img-responsive" src="<?php if ($user_info['logo'] != '') echo uimage_url($user_info['logo']); else echo image_default(); ?>">
        </a>
    </div>

    <div class="col-lg-12 col-md-12 col-sm-12 info-profile-footer">
        <div class="user-row">
            <span><?php echo $this->lang->line('complaints') ?></span><span
                class="col-right complaints">0/5</span>
        </div>
        <div class="user-row">
			<span><input id="preview-user" value="<?php echo $user_info['user_rating']?>" type="number"
                                             data-star-captions="{}" data-default-caption="{rating}"
                                             class="rating" min=0 max=5 data-size="xs" disabled="disabled"></span> <span
                class="col-right"><?php echo $user_info['num_reviews']?> reviews</span>
        </div>
        <div class="user-row">
            <span><?php echo $this->lang->line('spend') ?></span><span
                class="col-right price">$5324</span>
        </div>
    </div>
</div>
<!-- avatar-user -->

<div class="col-lg-9 col-sm-9 col-md-9 col-xs-12 info-profile">
        <div class="name-user col-lg-12 col-md-12 col-sm-12 ">
            <span class=""><?php echo $user_info['user_name']; ?></span>
        </div>
        <!-- name-user -->
        <div class="col-lg-12 col-md-12 col-sm-12  username">
            <div class="col-lg-2  x8-16">Username:</div>
            <div class="col-lg-10 x8-16">
                <div id="update_username">
                    <?php echo $user_info['user_name']; ?>
                </div>

            </div>
        </div>
        <!-- username -->
        <div class="col-lg-12 col-md-12 col-sm-12  location-user">
            <div class="col-lg-2 x8-16">Location:</div>
            <div class="col-lg-10 x8-16">
                <div id="update_location">
                    <?php echo $user_info['city']; ?>
                </div>
            </div>
        </div>
        <!-- location-user -->
        <div class="col-lg-12 col-md-12 col-sm-12 intro-user x8-13">
            <div id="update_description">
                <?php echo $user_info['profile_desc']; ?>
            </div>
        </div>

    <div class="skill-resume-user col-lg-12 col-md-12 col-sm-12 col-xs-12 row">
        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 skill-user">
            <p class="x8-20-b"><?php echo $this->lang->line("Skills") ?></p>

            <div id="show_add_skill">
                <ul>
                    <?php
                    if ($user_info['user_categories'] != "") {
                        echo getCategoryLinks($user_info['user_categories']);
                    }
                    ?>
                </ul>
            </div>

            <!-- <span><a href="/" id="addSkills">Thêm kỹ năng</a></span> -->
        </div>
        <!-- skill-user -->

        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 resume-user">
            <p class="x8-20-b"><?php echo $this->lang->line('Resume') ?></p>
            <ul class="list-resume">
                <?php
                if ($user_info['resume'] != "") {
                    $user_resume = unserialize($user_info['resume']);

                    if (is_array($user_resume)) {
                        foreach ($user_resume as $resume) {
                            ?>
                            <li><span><?php echo $resume; ?></span></li>
                        <?php
                        }
                    }
                }
                ?>
            </ul>
        </div>
        <!-- resume-user -->
    </div>
</div>
<!-- intro-user -->

</div>
<!-- info-user -->
</div>
<!-- profile-user -->
<div class="col-md-12">
    <div class="quote-last-55"></div>
</div>
</div>
</div>

</div>

<div class="wrap-content wrap-buyer-profile">
    <div class="col-md-12">
        <div class="border-green2 border col-md-1 col-xs-1 "></div>
        <div class="container">
            <div class="row title-project">
                <h2><?php echo $this->lang->line("Portfolio") ?></h2>
            </div>
        </div>
    </div>
    <div class="col-md-12">
	    <?php
	    if($portfolio->num_rows() > 0 ) {
			$portfolio = $portfolio->result();
	    	foreach($portfolio as $item){
				if (file_exists($this->config->item('static_path').'files/portfolios/'.$item->main_img)) {
					$image = portfolio_image_url('thumbs/' . $item->main_img);
				}else{
					$image = image_url("img_default_280.jpg");
				}
		?>
        <div class="col-lg-3 col-md-4 col-sm-4 col-xs-12 thumb">
            <div class="item-project">
                <a class="detail-portfolio" data-id="<?php echo $item->id;?>" data-toggle="modal"> 
                	<img alt="<?php echo $item->title?>" src="<?php echo $image?>" class="img-responsive">
                </a>

                <div class="details-item-home">
                	<span><a class="detail-portfolio" data-id="<?php echo $item->id;?>" data-toggle="modal"> <?php echo $item->title?></a></span>
                </div>
            </div>
            <!-- details-item-home -->
        </div>
        	<?php } ?>
     	<?php }else{ ?>
     	<div align="center">[<?php echo $this->lang->line('message portfolio empty')?>]</div>
     	<?php } ?>
    </div>
    <div style="clear:both"></div>
</div>

<div class="wrap-content wrap-feedback">
    <div class="container">
        <div class="row">
            <div class="border-white border col-md-1 col-xs-1 "></div>
            <div class="container">
                <div class="row title-project">
                    <h2><?php echo $this->lang->line("Feedback") ?></h2>
                </div>
            </div>
        </div>
        <div class="row">
            <!-- add-portfolio -->
            <div class="content-3-user col-lg-12 col-md-12 col-sm-12">
                <div class="content-feedback-user col-lg-12 col-md-12 col-sm-12 no-padding">
                    <div class="col-lg-7 col-md-7 col-sm-7 col-xs-12 no-padding content-left-feedback-user">
                        <div class="row">
                            <div class="col-lg-6 col-md-6 col-sm-6 label-feedback x62-14-b">
                                <?php echo $this->lang->line('Quality') ?>:
                            </div>
                            <!-- label-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 rating-feedback">
                                <input id="input-feedback" value="0" type="number"
                                       data-star-captions="{}" data-default-caption="{rating}"
                                       class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                            <!-- rating-feedback -->
                        </div>
                        <div class="row">
                            <div class="col-lg-6 col-md-6 col-sm-6 label-feedback x62-14-b">
                                <?php echo $this->lang->line("Exchange of information") ?>:
                            </div>
                            <!-- label-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 rating-feedback">
                                <input id="input-feedback" value="0" type="number"
                                       data-star-captions="{}" data-default-caption="{rating}"
                                       class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                        </div>
                        <div class="row">
                            <!-- rating-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 label-feedback x62-14-b">
                                <?php echo $this->lang->line("expertise") ?>:
                            </div>
                            <!-- label-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 rating-feedback">
                                <input id="input-feedback" value="0" type="number"
                                       data-star-captions="{}" data-default-caption="{rating}"
                                       class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                        </div>
                        <div class="row">
                            <!-- rating-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 label-feedback x62-14-b">
                                <?php echo $this->lang->line("Will hire again if the project") ?>:
                            </div>
                            <!-- label-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 rating-feedback">
                                <input id="input-feedback" value="0" type="number"
                                       data-star-captions="{}" data-default-caption="{rating}"
                                       class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                        </div>
                        <div class="row">
                            <!-- rating-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 label-feedback x62-14-b">
                                <?php echo $this->lang->line("professional") ?>:
                            </div>
                            <!-- label-feedback -->
                            <div class="col-lg-6 col-md-6 col-sm-6 rating-feedback">
                                <input id="input-feedback" value="0" type="number"
                                       data-star-captions="{}" data-default-caption="{rating}"
                                       class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                        </div>
                        <!-- rating-feedback -->
                    </div>
                    <!-- content-left-feedback-user -->
                    <div class="col-lg-5  col-md-5 col-sm-5 col-xs-12 content-right-feedback-user">
                        <div class="col-md-12 label-feedback-right x62-14-b">
                            <?php echo $this->lang->line("Completion Rate") ?>: 98%
                        </div>
                        <!-- label-feedback -->
                        <div class="col-md-12 label-feedback-right x62-14-b">
                            <?php echo $this->lang->line("On budget") ?>: 98%
                        </div>
                        <!-- label-feedback -->
                        <div class="col-md-12 label-feedback-right x62-14-b">
                            <?php echo $this->lang->line("On time") ?>: 98%
                        </div>
                        <!-- label-feedback -->
                        <div class="col-md-12 total-feedback x8-20-b">
                            <p> <?php echo $this->lang->line("All project join") ?> : <span>5</span></p>
                        </div>
                    </div>
                    <!-- content-right-feedback-user -->
                </div>
                <!-- content-feedback-user -->
            </div>
            <!-- content-3-user -->
        </div>
    </div>
</div>
<div class="wrap-content wrap-feedback-comment">
    <div>
        <div class="comment-feedback content-4 col-lg-12 col-sm-12 col-md-12 col-xs-12 no-padding">
        	<?php 
	        if(isset($reviews) && $reviews->num_rows() > 0){
	        	foreach ($reviews->result() as $item){
	        ?>
            <div class="container">
                <div class="item-comment-feedback col-lg-12 row no-padding">
                    <div class="col-lg-3 col-sm-3 col-md-3 avatar-user col-xs-12 no-padding">
                        <a href="<?php echo site_url("programmer/viewProfile/".$item->user_id)?>"><img class="img-responsive" src="<?php echo ($item->logo != '')? uimage_url($item->logo):image_default(); ?>"></a>

                        <div class="feedback-user-footer">
                            <div class="user-row"><span><?php echo $item->user_name;?></span><span class="col-right complaints">$500</span>
                            </div>
                            <div class="user-row">
                                <input id="preview-user" value="<?php echo $item->user_rating;?>" type="number" data-star-captions="{}"
                                       data-default-caption="{rating}" class="rating" min=0 max=5 data-size="xs" disabled="disabled">
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-9 col-sm-9 col-xs-12 col-md-9 right-comment-feedback">
                        <div class="content-feedback col-lg-12 col-sm-12 col-md-12 col-xs-12">
                            <div class="arrow-feedback"></div>
                            <p><?php echo $item->comments;?></p>
                            <span class="time-feedback"><?php echo count_days_before($item->review_time, now());?></span>
                        </div>
                        <!-- content-feedback -->
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        </div>
                    </div>
                </div>
            </div>
            <div class="line-feedback"></div>
            <?php } ?>
            <?php } ?>
        </div>
        <!-- comment-feedback -->
        <div class="freelancer-pagination comment-pagination col-lg-12 col-md-12 col-sm-12">
            <?php echo $pagination;?>
        </div>
        <!-- freelancer pagination -->
    </div>
    <div style="clear: both;"></div>
    <!-- end row content -->
</div>
<!-- wrap-content -->

<!-- modal -->
<div class="modal fade" id="modal-invite-freelancer">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header modal-title-invite-freelancer">
                <span type="button" class="close" data-dismiss="modal" aria-hidden="true">×</span>
                <h4 class="modal-title">Invitation Sent!</h4>
            </div>
            <div class="modal-body">
            <?php $this->load->view('project/viewNoticeAfterInviteFreelancer');?>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script type="text/javascript">
    $(document).ready(function(){
        <?php
            if(isset($notice_invite)){
        ?>
             $("#modal-invite-freelancer").modal({
                    "keyboard"  : true,
                    "show"      : true   
                })// end show modal
        <?php
            }
        ?>

       
    })
</script>
<!--END OF MAIN-->
<?php $this->load->view('footer'); ?>



